﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using MvcApplication2.Models;

namespace MvcApplication2.DAL
{
    public class DBInitializer : DropCreateDatabaseIfModelChanges<Context>
    {
        protected override void Seed(Context context)
        {
            var manufacturers = new List<Manufacturer>
            {
                new Manufacturer { ManufacturerName = "Teknoser"},
                new Manufacturer { ManufacturerName = "Proserv"},
                new Manufacturer { ManufacturerName = "Mobisis"}
            };
            manufacturers.ForEach (m => context.Manufacturers.Add(m));
            context.SaveChanges();
        }
    }
}